<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core' %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%
    /**
     * @Description :  게시판관리
     * @Modification Information
     *
     *   수정일               수정자                   수정내용
     *  -------    --------    ---------------------------
     *
     *
     */
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />    
<title><tiles:insertAttribute name="headtitle" ignore="true"/></title>

<link rel="stylesheet" type="text/css" media="screen" href="<c:url value='/resources/css/jquery/start/jquery-ui-1.10.3.custom.css'/>" />
<link rel="stylesheet" type="text/css" media="all"  href="<c:url value='/resources/css/kickstart/kickstart.css'/>"/> <!-- KICKSTART -->

<script type="text/javascript" src="<c:url value='/resources/js/jquery/jquery-1.9.0.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/resources/js/jquery/jquery-ui-1.10.3.custom.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/resources/js/kickstart/kickstart.js'/>"></script> <!-- KICKSTART -->
<%@include file="/WEB-INF/jsp/common/commonJs.jsp"%> 

<!-- additional -->
<script type="text/javascript" src="<c:url value='/resources/js/jquery/plugin/form/jquery.form.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/resources/js/jquery/plugin/validate/jquery.validate.min.js'/>"></script>
<!-- //additional -->

<script type="text/javascript">
//********************************************************
// form process area   
//********************************************************
// !! load 함수로 url호출하여 받은 컨텐츠를 partial하게 변경한 경우 
//    docuemnt ready 이벤트에서
//    폼요소에 값을 세팅하면 안되고 load콜백 함수에서 처리해야 한다.
//    사용법에 주의하여 아래와 같이 load플래그를 써서 분기 처리
var firstLoad = true; 

/**
 * 상세보기
 */
function detail(bbsId) {
	firstLoad = false;
    $("#divDetail").load('<c:url value="/adm/admBoardMngr/selectBoardOne"/>?bbs_id='+bbsId, function(response, status, xhr) {
    	if(status == 'error') {
    		viewError(response); 
    		return false;
    	}
    	initPage();
    });
}
</script>
</head>
<body>

<div class="col_12 right">
    <button id="btnSearch">조회</button>
</div>
<br/>
<!-- Table -->
<table cellspacing="0" cellpadding="0">
<thead>
    <tr>
        <th>게시판ID</th>
        <th>게시판명</th>
        <th>게시판설명</th>
        <th>미리보기</th>
    </tr>
</thead>
<tbody>
<c:if test="${empty list}">
    <tr>
        <td>
            결과데이터가 존재하지 않습니다.
        </td>
    </tr>
</c:if>
<c:forEach var="row" items="${list}" varStatus="status">
    <tr>
        <td onclick="">${row.BBS_ID}</td>
        <td><a href="javascript:detail('${row.BBS_ID}')">${row.BBS_NAME}</a></td>
        <td>${row.BBS_DESC}</td>
        <td><a href="<c:url value="/bbs/bbsGeneralBoard/list"/>?bbs_id=${row.BBS_ID}" target="_new">
            <c:url value="/bbs/bbsGeneralBoard/list"/>?bbs_id=${row.BBS_ID}</a></td>
    </tr>
</c:forEach> 
</tbody>
</table>

<hr>

<!-- 등록폼 -->
<div id="divDetail">
<%@include file="admBoardMngrDetail.jsp"%> 
</div>
<!-- //등록폼 -->

<!-- dummy form for ajax -->
<!--<form id="dummyForm1" name="dummyForm1" method="post">
</form>-->
<!-- //dummy form for ajax -->

</body>
</html>